// main.js
import App from './App'
import { createSSRApp } from 'vue'
import * as Pinia from 'pinia'
import { createUnistorage } from 'pinia-plugin-unistorage'

import cuCustom from './colorui/components/cu-custom.vue'

export function createApp() {
  const app = createSSRApp(App)

  const store = Pinia.createPinia()

  // 关键代码
  store.use(createUnistorage())

  app.component('cu-custom',cuCustom)
  app.use(store)

  return {
    app,
    Pinia // 此处必须将 Pinia 返回
  }
}
